#include "FormatString/GUIFormattedWrapComponent.h"
#include "FormatString/GUIFormattedUserData.h"
#include "include/GUIBase.h"

namespace YGUI
{
    FormattedWrapComponent::FormattedWrapComponent(void) : 
        FormattedStringComponent(FT_LineFeed)
    {
    }

    FormattedWrapComponent::~FormattedWrapComponent(void)
    {
    }

    FormattedWrapComponent::FormattedWrapComponent(const FormattedWrapComponent& _Right) :
        FormattedStringComponent(_Right.m_fmtType)
    {
        m_padding = _Right.m_padding;
        m_userData = _Right.m_userData == 0 ? 0 : _Right.m_userData->clone();
    }

    void FormattedWrapComponent::setPosition(const Vector2<float>& pos)
    {
    }

    Rect<float> FormattedWrapComponent::getRect(void) const
    {
        return Rect<float>();
    }
    void FormattedWrapComponent::draw(GeometryBuffer& buffer, const ColourRect* mod_color,
                const Rect<float>* clip_rect, float vertical_space, float space_extra) const
    {
    }

    void FormattedWrapComponent::invalidate(void)
    {
    }

    bool FormattedWrapComponent::isFormattedEquals(FormattedStringComponent* _Right) const
    {
        if(_Right == 0)
            return false;
        if(m_fmtType != _Right->getFormattedType())
            return false;
        FormattedWrapComponent* fRight = (FormattedWrapComponent*)(_Right);
        if(m_padding != fRight->m_padding)
            return false;
        return true;
    }

    FormattedStringComponent* FormattedWrapComponent::clone(void) const
    {
        return MEMCHECK_NEW FormattedWrapComponent(*this);
    }
}